package leetcode;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by MtRider on 2021/10/16 14:06
 */
public class CombineList {
    public static void main(String[] args) {
        int [] nums={3,2,2,3};
        removeElement(nums,3);
    }
    public static int removeElement(int[] nums, int val) {
        if(nums.length == 0){
            return 0;
        }
        int j=0;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]==val){
                nums[j]=nums[i];
                j++;
            }
        }
        return nums.length;
    }
}
